package com.szpxt.service;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Component;

import com.szpxt.model.Financing;

@Component
public class FinancingService extends HibernateDaoSupport {
	
	private UserService userService;
	
	public Financing create(String name, String company, String mobile, String eMail, Double amount, String serialNumber) {
		Financing financing = new Financing();
		financing.setName(name);
		financing.setCompany(company);
		financing.setMobile(mobile);
		financing.setEMail(eMail);
		financing.setAmount(amount);
		financing.setSerialNumber(serialNumber);
		
		getHibernateTemplate().saveOrUpdate(financing);
		
		return financing;
	}

	//获取和设置方法
	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
}
